package cn.edu.scau.cmi.chenjia.composite.consistent;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

public class ConsistentTeam extends ConsistentOrganization{
	private String name;
	private String department;
	
	public List<ConsistentOrganization> children=new ArrayList();
	
	public ConsistentTeam(String name,String department) {
		this.name=name;
		this.department=department;
	}
	
	@Override
	public String doSomething() {
		//System.out.println("你好，我是一致型组件");

		return "你好，我是一致型组件";
	}

	@Override
	public ConsistentOrganization getParent() {
		return this.getParent();
	}

	@Override
	public List<ConsistentOrganization> getChildren() {
		// TODO Auto-generated method stub
		return children;
	}

	@Override
	public ConsistentOrganization addChild(ConsistentOrganization child) {
		//System.out.println("现在准备再组合节点中添加子节点");
		this.children.add(child);
		return this;
	}

	@Override
	public ConsistentOrganization deleteChild(ConsistentOrganization child) {
		children.remove(child);
		return this;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public String getDepartment() {
		return department;
	}

	public void setDepartment(String department) {
		this.department = department;
	}
}
